#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
typedef int SLDateType;
typedef struct SLTlist
{
	SLDateType size;
	struct SLTlist* next;
}SLTlist;
SLTlist* BuySLTNode(SLDateType x)
{
    SLTlist* newnode = (SLTlist*)malloc(sizeof(SLTlist));
	newnode->size=x;
	newnode->next = NULL;
	return newnode;
}
void pushback(SLTlist** pphead, SLDateType x)
{
	assert(pphead);
	SLTlist* newnode = BuySLTNode(x);
	if (*pphead == NULL)
	{
		*pphead = newnode;
	}
	else
	{
		SLTlist* tail = *pphead;
		while (tail->next != NULL)
		{
			tail = tail->next;
		}
		tail->next = newnode;
	}
}
void SLTinsert(SLTlist** pphead,SLTlist *pos,SLDateType x)
{
	assert(pphead);
	if (pos == *pphead)
	{
		pushback(pphead,x);
	}
	else
	{
		SLTlist* prex = *pphead;
		while (prex->next!=pos)
		{
			prex = prex->next;
		}
		SLTlist* newnode = BuySLTNode(x);
		prex->next = newnode;
		newnode->next = pos;
	}
}
SLTlist* SLTfind(SLTlist* phead, SLDateType x)
{
	SLTlist* cur = phead;
	while (cur)
	{
		if (cur->size == x)
			return cur;
		cur = cur->next;
	}
	return NULL;
}
void Afterinsertback(SLTlist** pphead,SLTlist* pos,SLDateType x)
{
	assert(pphead);
	SLTlist* newnode = BuySLTNode(x);
	newnode->next = pos->next;
	pos->next = newnode;
}
void popfront(SLTlist** pphead)
{
	assert(pphead);
	SLTlist* first = *pphead;
	*pphead = first->next;
	free(first);
	first = NULL;
}

void SLTErase(SLTlist** pphead, SLTlist* pos)
{
	assert(pphead);
	assert(pos);
	SLTlist* cur == *pphead;
	if (*pphead = pos)
	{
		popfront(pphead);
	}
	else
	{
		while (cur->next != pos)
		{
			cur = cur->next;
		}
		cur->next = pos->next;
		free(pos);
		pos = NULL;
	}
}
void SLTEraseAfter(SLTlist** pphead,SLTlist* pos)
{
	SLTlist* cur =  pos->next;
	pos->next = cur->next;
	free(cur);
	cur = NULL;
}

int main()
{
	return 0;
}